<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>闭包案例</title>
</head>
<body>
    <script>
        // getSalary(8000, 1000)
        // getSalary(12000, 1200)
        // getSalary(12000, 1500)
        function getSalary(base){
            return function (performance){
                return base+performance
            }
        }
        const salaryLevel1 = getSalary(8000)
        const salaryLevel2 = getSalary(12000)
        console.log(salaryLevel1(1000))
        console.log(salaryLevel1(1200))
        console.log(salaryLevel1(1500))
    </script>
</body>
</html>